#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 0;
	scanf("%d", &a);
	int b = 0;
	int c= 0;
	int d = 0;
	int e = 0;
	b = a % 10;
	c = a / 10 % 10;
	d = a / 100 % 10;
	e = a / 1000;
	printf("%d",b );
	printf("%d",c );
	printf("%d", d);
	printf("%d", e);
	return 0;
}